package com.xuhao.examai.controller.api;

import com.xuhao.examai.model.vo.ResultVO;
import com.xuhao.examai.service.MarkingService;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/marking")
public class MarkingController {
    private final MarkingService markingService;
    public MarkingController(MarkingService markingService) { this.markingService = markingService; }

    // 教师批改主观题
    @PostMapping("/answer/{answerRecordId}/score")
    public ResultVO<Void> markAnswer(@PathVariable Long answerRecordId, @RequestParam Integer score, @RequestParam(required = false) String comment) {
        markingService.markAnswer(answerRecordId, score, comment);
        return ResultVO.success(null);
    }
}
